Skip to content

fix(adapters): expose noticeDelivery advertisements and gate resources/updated wiring on them (#99, #362 follow-up) - #412

Merged
ScriptedAlchemy merged 2 commits into
mainfrom
fix/362-notice-delivery-surface
Sep 3, 2026
Merged

fix(adapters): expose noticeDelivery advertisements and gate resources/updated wiring on them (#99, #362 follow-up)#412
ScriptedAlchemy merged 2 commits into
mainfrom
fix/362-notice-delivery-surface

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Follow-up to the unaddressed P1 on #362 (per-host noticeDelivery tables landed in capability JSON but were not exposed through the adapter API, and nothing consumed them). Was stacked on #376; #376 is merged (23ee0f529) and this PR now targets main.

Summary

  • TargetAdapter.noticeDelivery?: NoticeDeliveryAdvertisement — the advertisement shape (NOTICE_DELIVERY_ROUTES, NoticeDeliveryRoute, NoticeDeliveryRouteState, NoticeDeliveryAdvertisement) is defined locally in src/adapters/notice-delivery.ts and exported from the package root, so public declarations never resolve through the optional @agent-bundle/runtime peer; a test asserts mutual assignability with the runtime's AgentNoticeDeliveryAdvertisement.
  • Each built-in adapter (claude, codex, cursor, portable) populates it from its capability table via noticeDeliveryAdvertisementFrom(), which fails closed on a row it cannot describe (unknown route, missing route, unknown state, unavailable whose reason carries no ISO survey date YYYY-MM-DD).
  • plugin (composite) advertises the intersection of its three hosts (intersectNoticeDeliveryAdvertisements()); reasons are merged, deduplicated, sorted.
  • TargetRegistry.register() re-validates the advertisement at the JavaScript boundary (CapabilityStateError; no diagnostic codes added or changed); registry.noticeDelivery(name) exposes the snapshot.
  • Entry generation gates both notice routes on the advertisement: the agent-bundle://notices/inbox resource (mcp-inbox) is registered and mounted in the Flight worker only where the host advertises mcp-inbox: supported; resources/subscribe + notifications/resources/updated (mcp-resource-updated) only where the host additionally advertises mcp-resource-updated: supported and state is workspace-durable. build and inspect --bundler both thread the advertisement. Built-in hosts all advertise mcp-inbox, so their artifacts are unchanged.
  • docs/entry-conventions.md documents the gates; changeset for agent-bundle. The docsite's notice delivery matrix and API pages are generated from the capability tables / TypeDoc and follow the source.

Evidence

  • adapter-capability-states.test.ts: adapter/registry exposure typed for selectNoticeDeliveryRoutes; local↔runtime type assignability; intersection semantics; fail-closed table parsing incl. undated reasons; registry re-validation incl. undated reasons.
  • entry-shell.test.ts: mcp-inbox advertised → inbox route present; unadvertised / unavailable → no inbox route and no resources.subscribe; mcp-resource-updated wiring only with inbox + durable state.

Test plan

  • pnpm build, pnpm typecheck, pnpm lint
  • pnpm test:unit (only native-claude-contract fails locally; identical failure on origin/main in this environment, passes in CI), pnpm test:route-unit, pnpm test:projection
  • Codex review threads swept: 4 found / 4 fixed / 4 replied+resolved
  • CI green on a99597c0b

Review status

Automated reviewer (chatgpt-codex-connector) last covered head 8f5a6e9f00 (review of 2026-09-03T09:52Z; earlier 0ab50d6224, 0305eb3973). Every thread it left is fixed and replied. It did not review 2888b1639, 4274e5d81, a5513e710, bd4ab852e, 6aa9a2724, ae1eba139, or the current head a99597c0b (same tree as ae1eba139, re-pushed to trigger CI after retargeting) (rebases onto #376/main, conflict resolutions, and the dated-reason + changeset fixes): @codex review returned "usage limits reached" at 15:02Z and 15:25Z. Per the maintainer's amendment, merging on CI green; request a follow-up review of a99597c0b when credits return.

@changeset-bot

changeset-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a99597c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
agent-bundle Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-03T09:52:06.336723Z 8f5a6e9 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

pkg-pr-new Bot commented Sep 3, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@412
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@412
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@412

commit: a99597c

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ab50d6224

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/agent-bundle/src/adapters/types.ts Outdated
Comment thread packages/agent-bundle/src/build/entry-shell.ts Outdated
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/362-notice-delivery-surface branch from 0ab50d6 to f46e051 Compare September 3, 2026 08:14
ScriptedAlchemy added a commit that referenced this pull request Sep 3, 2026
…nd gate the inbox route on its own advertisement

Codex P1/P2 on #412:
- TargetAdapter.noticeDelivery and every build-side signature now use a local
  NoticeDeliveryAdvertisement (adapters/notice-delivery.ts) so no public
  declaration of agent-bundle resolves through the optional
  @agent-bundle/runtime peer; a test asserts mutual assignability with the
  runtime's AgentNoticeDeliveryAdvertisement and route list.
- The agent-bundle://notices/inbox resource is registered in the server and
  mounted in its Flight worker only where the host advertises mcp-inbox;
  mcp-resource-updated additionally requires the inbox. The worker still
  mounts the ledger so routes can publish, and the reserved name stays
  reserved.
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 0305eb3973

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

ScriptedAlchemy added a commit that referenced this pull request Sep 3, 2026
…nd gate the inbox route on its own advertisement

Codex P1/P2 on #412:
- TargetAdapter.noticeDelivery and every build-side signature now use a local
  NoticeDeliveryAdvertisement (adapters/notice-delivery.ts) so no public
  declaration of agent-bundle resolves through the optional
  @agent-bundle/runtime peer; a test asserts mutual assignability with the
  runtime's AgentNoticeDeliveryAdvertisement and route list.
- The agent-bundle://notices/inbox resource is registered in the server and
  mounted in its Flight worker only where the host advertises mcp-inbox;
  mcp-resource-updated additionally requires the inbox. The worker still
  mounts the ledger so routes can publish, and the reserved name stays
  reserved.
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/362-notice-delivery-surface branch from 0305eb3 to 92890e2 Compare September 3, 2026 08:32
@ScriptedAlchemy
ScriptedAlchemy force-pushed the feat/99-s4-resource-updated branch from f1545d0 to a2344e1 Compare September 3, 2026 08:52
ScriptedAlchemy added a commit that referenced this pull request Sep 3, 2026
…nd gate the inbox route on its own advertisement

Codex P1/P2 on #412:
- TargetAdapter.noticeDelivery and every build-side signature now use a local
  NoticeDeliveryAdvertisement (adapters/notice-delivery.ts) so no public
  declaration of agent-bundle resolves through the optional
  @agent-bundle/runtime peer; a test asserts mutual assignability with the
  runtime's AgentNoticeDeliveryAdvertisement and route list.
- The agent-bundle://notices/inbox resource is registered in the server and
  mounted in its Flight worker only where the host advertises mcp-inbox;
  mcp-resource-updated additionally requires the inbox. The worker still
  mounts the ledger so routes can publish, and the reserved name stays
  reserved.
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/362-notice-delivery-surface branch from 92890e2 to ad91df1 Compare September 3, 2026 08:55
ScriptedAlchemy added a commit that referenced this pull request Sep 3, 2026
…nd gate the inbox route on its own advertisement

Codex P1/P2 on #412:
- TargetAdapter.noticeDelivery and every build-side signature now use a local
  NoticeDeliveryAdvertisement (adapters/notice-delivery.ts) so no public
  declaration of agent-bundle resolves through the optional
  @agent-bundle/runtime peer; a test asserts mutual assignability with the
  runtime's AgentNoticeDeliveryAdvertisement and route list.
- The agent-bundle://notices/inbox resource is registered in the server and
  mounted in its Flight worker only where the host advertises mcp-inbox;
  mcp-resource-updated additionally requires the inbox. The worker still
  mounts the ledger so routes can publish, and the reserved name stays
  reserved.
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/362-notice-delivery-surface branch 2 times, most recently from ad91df1 to dd92931 Compare September 3, 2026 09:32
ScriptedAlchemy added a commit that referenced this pull request Sep 3, 2026
…nd gate the inbox route on its own advertisement

Codex P1/P2 on #412:
- TargetAdapter.noticeDelivery and every build-side signature now use a local
  NoticeDeliveryAdvertisement (adapters/notice-delivery.ts) so no public
  declaration of agent-bundle resolves through the optional
  @agent-bundle/runtime peer; a test asserts mutual assignability with the
  runtime's AgentNoticeDeliveryAdvertisement and route list.
- The agent-bundle://notices/inbox resource is registered in the server and
  mounted in its Flight worker only where the host advertises mcp-inbox;
  mcp-resource-updated additionally requires the inbox. The worker still
  mounts the ledger so routes can publish, and the reserved name stays
  reserved.
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/362-notice-delivery-surface branch from dd92931 to 8f5a6e9 Compare September 3, 2026 09:44
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f5a6e9f00

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .changeset/notice-delivery-adapter-surface.md Outdated
Comment thread packages/agent-bundle/src/adapters/capability-state.ts Outdated
@ScriptedAlchemy
ScriptedAlchemy force-pushed the feat/99-s4-resource-updated branch from 96ae320 to 2c91511 Compare September 3, 2026 10:21
ScriptedAlchemy added a commit that referenced this pull request Sep 3, 2026
…nd gate the inbox route on its own advertisement

Codex P1/P2 on #412:
- TargetAdapter.noticeDelivery and every build-side signature now use a local
  NoticeDeliveryAdvertisement (adapters/notice-delivery.ts) so no public
  declaration of agent-bundle resolves through the optional
  @agent-bundle/runtime peer; a test asserts mutual assignability with the
  runtime's AgentNoticeDeliveryAdvertisement and route list.
- The agent-bundle://notices/inbox resource is registered in the server and
  mounted in its Flight worker only where the host advertises mcp-inbox;
  mcp-resource-updated additionally requires the inbox. The worker still
  mounts the ledger so routes can publish, and the reserved name stays
  reserved.
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/362-notice-delivery-surface branch from 8f5a6e9 to 65b6293 Compare September 3, 2026 10:23
ScriptedAlchemy added a commit that referenced this pull request Sep 3, 2026
…nd gate the inbox route on its own advertisement

Codex P1/P2 on #412:
- TargetAdapter.noticeDelivery and every build-side signature now use a local
  NoticeDeliveryAdvertisement (adapters/notice-delivery.ts) so no public
  declaration of agent-bundle resolves through the optional
  @agent-bundle/runtime peer; a test asserts mutual assignability with the
  runtime's AgentNoticeDeliveryAdvertisement and route list.
- The agent-bundle://notices/inbox resource is registered in the server and
  mounted in its Flight worker only where the host advertises mcp-inbox;
  mcp-resource-updated additionally requires the inbox. The worker still
  mounts the ledger so routes can publish, and the reserved name stays
  reserved.
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/362-notice-delivery-surface branch from 65b6293 to ab61a53 Compare September 3, 2026 10:58
ScriptedAlchemy added a commit that referenced this pull request Sep 3, 2026
…nd gate the inbox route on its own advertisement

Codex P1/P2 on #412:
- TargetAdapter.noticeDelivery and every build-side signature now use a local
  NoticeDeliveryAdvertisement (adapters/notice-delivery.ts) so no public
  declaration of agent-bundle resolves through the optional
  @agent-bundle/runtime peer; a test asserts mutual assignability with the
  runtime's AgentNoticeDeliveryAdvertisement and route list.
- The agent-bundle://notices/inbox resource is registered in the server and
  mounted in its Flight worker only where the host advertises mcp-inbox;
  mcp-resource-updated additionally requires the inbox. The worker still
  mounts the ledger so routes can publish, and the reserved name stays
  reserved.
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/362-notice-delivery-surface branch from 5613425 to 14a16df Compare September 3, 2026 12:25
ScriptedAlchemy added a commit that referenced this pull request Sep 3, 2026
…nd gate the inbox route on its own advertisement

Codex P1/P2 on #412:
- TargetAdapter.noticeDelivery and every build-side signature now use a local
  NoticeDeliveryAdvertisement (adapters/notice-delivery.ts) so no public
  declaration of agent-bundle resolves through the optional
  @agent-bundle/runtime peer; a test asserts mutual assignability with the
  runtime's AgentNoticeDeliveryAdvertisement and route list.
- The agent-bundle://notices/inbox resource is registered in the server and
  mounted in its Flight worker only where the host advertises mcp-inbox;
  mcp-resource-updated additionally requires the inbox. The worker still
  mounts the ledger so routes can publish, and the reserved name stays
  reserved.
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/362-notice-delivery-surface branch from 14a16df to 66def4c Compare September 3, 2026 12:51
ScriptedAlchemy added a commit that referenced this pull request Sep 3, 2026
…nd gate the inbox route on its own advertisement

Codex P1/P2 on #412:
- TargetAdapter.noticeDelivery and every build-side signature now use a local
  NoticeDeliveryAdvertisement (adapters/notice-delivery.ts) so no public
  declaration of agent-bundle resolves through the optional
  @agent-bundle/runtime peer; a test asserts mutual assignability with the
  runtime's AgentNoticeDeliveryAdvertisement and route list.
- The agent-bundle://notices/inbox resource is registered in the server and
  mounted in its Flight worker only where the host advertises mcp-inbox;
  mcp-resource-updated additionally requires the inbox. The worker still
  mounts the ledger so routes can publish, and the reserved name stays
  reserved.
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/362-notice-delivery-surface branch from 66def4c to 2888b16 Compare September 3, 2026 13:19
@ScriptedAlchemy
ScriptedAlchemy force-pushed the feat/99-s4-resource-updated branch from 8ad53a1 to 473f963 Compare September 3, 2026 13:56
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/362-notice-delivery-surface branch 2 times, most recently from 4274e5d to a5513e7 Compare September 3, 2026 14:22
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/362-notice-delivery-surface branch from a5513e7 to bd4ab85 Compare September 3, 2026 15:01
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

…and gate the notice routes on them

- add a per-target noticeDelivery advertisement to TargetAdapter and the
  registry, with the delivery shape defined locally in the compiler
  (adapters/notice-delivery.ts) so the optional runtime peer never
  enters public declarations; a test asserts mutual assignability with
  @agent-bundle/runtime/notices
- wire the mcp-inbox route only when the target advertises it as
  supported, and mcp-resource-updated only when both it and the inbox
  are advertised; thread noticeDelivery through entries, build, and
  inspect-bundler
- consumer-facing changeset for agent-bundle
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/362-notice-delivery-surface branch from bd4ab85 to ae1eba1 Compare September 3, 2026 15:25
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@ScriptedAlchemy
ScriptedAlchemy changed the base branch from feat/99-s4-resource-updated to main September 3, 2026 15:27
… reasons; state the diagnostic-code impact in the changeset
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/362-notice-delivery-surface branch from ae1eba1 to a99597c Compare September 3, 2026 15:29
@ScriptedAlchemy
ScriptedAlchemy merged commit 9b7fe81 into main Sep 3, 2026
13 checks passed
ScriptedAlchemy added a commit that referenced this pull request Sep 3, 2026
#428)

Document the user-facing behaviour that landed on main after the docsite
PR (#384) merged, in both locales:

- install: `agent-bundle install cursor --mode local|marketplace` and the
  Doctor findings for Cursor hook registration and marketplace staging
  (AB7322-AB7324) (#414)
- project structure: per-host feature sets for src/commands and src/rules,
  with AB4907/AB4908 and AB4927/AB4928 (#427)
- testing: the script-dispatch and workbench-surface proof levels, eleven in
  all, and the routed cli-tool template (#398)
- notices reference: inbox and resources/updated wiring gated on the host's
  noticeDelivery advertisement (#412, #376)
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Review-status tracking (final sweep, 2026-09-03 16:37 UTC): @codex review re-requested for the merged head; the connector answered usage limits reached. Last Codex-reviewed commit: 8f5a6e9f00 (09:52 UTC). Unreviewed: the rebased commits 6aa9a2724a and a99597c0ba (head; range formerly 2888b1639a99597c0b) and the squash merge 9b7fe81261. Re-request once credits return; all four threads on this PR are answered.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant